<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>vue</title>
		
	</head>
	<body>
		<div id="app">
			<p v-text="message"></p>
			<p>{{ message }}</p>
			<input v-model="message"  @click="foo1"  @change="foo2" placeholder="edit me">
			<h6>input 绑定@click / @change 方法</h6>
			<br>
			<p>v-html</p>
			<p v-html="msg"></p>
			<br>
			<button v-on:click="doThis(123,obj.name)">点击改变data对象里的值</button>
		</div>
		
		<script src="./js/dep.js"></script>
		<script src="./js/watcher.js"></script>
		<script src="./js/compiler.js" type="text/javascript" charset="utf-8"></script>
		<script src="./js/observer.js" type="text/javascript" charset="utf-8"></script>
		<script src="./js/vue.js" type="text/javascript" charset="utf-8"></script>
		
		<script type="text/javascript">
			let vm = new Vue({
				el:'#app',
				data:{
					message:'vue',
					msg : "<h1>这是一个h1元素内容</h1>",
					obj:{
						name:'zhao'
					}
				},
				methods:{
					doThis(num,txt){
						console.log('this',this);
						console.log('第一个参数',num);
						console.log('第二个参数',txt);
						this.message = "VUE"
						this.msg = "<h3>这是一个h3元素内容</h3>"
						
					},
					foo1(){
						console.log(this.message)
					},
					foo2(){
						console.log(this.message)
					}
				}
			})
			
			// vm.msg = {txt:'LEAF'}
			
			
			
			
			// console.log(vm)
		</script>
		
	</body>
</html>
